package com.ditri.distrident.common.constant;

import com.ditri.distrident.common.entity.Result;

/**
 * @Author: edxuanlen
 * @Date: 2020/8/1:21:47
 */

public enum ErrorCodeEnum {

    /**
     * Success code
     */
    SUCCESS("10000", "success"),
    PASSWORD_ERROR("10001", "password error"),
    NO_SUCH_USER_ERROR("10002", "no such user"),
    SEND_MAIL_FREQUENTLY("10003", "Too many requests sent in a short time"),
    MAX_MAIL_SENT_TODAY("10004", "maximum number of mail sent today"),
    INTERRUPTED_EXCEPTION("10005", "program interrupt exception"),
    MIME_MESSAGE_CREATE_ERROR("10006", "java mail create MimeMessage error"),
    MAIL_ADDRESS_FORMAT_ERROR("10007", " mail address format error"),
    SMS_SEND_SUBMIT_ERROR("10008", "sms send submit error"),
    NO_MORE_SMS_TIMES("10009", "no more sms times"),
    PHONE_FORMAT_ERROR("10010", "phone format error"),
    SMS_SEND_OTHER_ERRORS("10011", "sms send other errors"),
    SMS_SEND_FREQUENTLY("10012", "sms send frequently"),

    AUTH_CODE_MISMATCH("10013", "auth code mismatch"),
    AUTH_CODE_IS_OVERDUE("10014", "auth code is overdue"),

    ;


    private String code;
    private String message;

    ErrorCodeEnum(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Result getResult() {
        return new Result(code, message);
    }
}
